package com.atguigu.exam.service.impl;

import com.atguigu.exam.entity.ExamRecord;
import com.atguigu.exam.mapper.ExamRecordMapper;
import com.atguigu.exam.service.ExamRecordService;
import com.atguigu.exam.vo.ExamRankingVO;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 考试记录Service实现类
 * 实现考试记录相关的业务逻辑
 */
@Service
public class ExamRecordServiceImpl extends ServiceImpl<ExamRecordMapper, ExamRecord> implements ExamRecordService {


    /**
     * 获取考试排行榜 - 优化版本
     * @param paperId
     * @param limit
     * @return
     */
    @Override
    public List<ExamRankingVO> getExamRankingOptimized(Integer paperId, Integer limit) {
        return baseMapper.selectExamRanking(paperId,limit);
    }
}